<!--!
This file is a part of MediaDrop (https://www.mediadrop.video),
Copyright 2009-2018 MediaDrop contributors
For the exact contribution history, see the git revision log.
The source code contained in this file is licensed under the GPLv3 or
(at your option) any later version.
See LICENSE.txt in the main project directory, for more information.
-->
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:i18n="http://genshi.edgewall.org/i18n"
      py:strip="">
	<table py:def="podcast_table(collection, include_thead=True, id='media-table')"
	       cellpadding="0" cellspacing="0" id="${id}"
	       py:with="item_count = len(collection);
	                paginator = c.paginators.podcasts">
		<tbody>
			<tr py:if="item_count == 0">
				<td>None Found</td>
			</tr>
			<py:for each="podcast in collection">
				<tr class="thead-row">
					<td colspan="2">
						<a href="${h.url_for(action='edit', id=podcast.id)}" class="btn inline f-rgt"><span>Edit</span></a>
						<h3><a href="${h.url_for(action='edit', id=podcast.id)}">${podcast.title}</a></h3>
					</td>
				</tr>
				<tr>
					<td class="podcast-art-col">
						<div class="podcast-art">
							<a href="${h.url_for(action='edit', id=podcast.id)}"><img src="${h.thumb_url(podcast, 'm')}" width="154" height="154" alt="Thumb" /></a>
						</div>
					</td>
					<td class="podcast-info" style="width:auto">
						<div class="info-content">
							<p py:replace="Markup(h.truncate_xhtml(podcast.description, 375))">Description</p>
							<div class="podcast-meta">
								<span class="podcast-category"><strong>Category:</strong> ${podcast.category or 'None'}</span>
								<span class="podcast-author">
									<strong>Author:</strong>
									<a href="mailto:${podcast.author.email}" py:strip="not podcast.author.email">${podcast.author.name or podcast.author.email or 'None'}</a>
								</span>
								<py:choose test="podcast.explicit">
									<span py:when="True" class="explicit"><strong>Explicit</strong></span>
									<span py:when="False" class="clean"><strong>Clean</strong></span>
								</py:choose>
								<span py:if="podcast.copyright" class="copyright">&copy; ${podcast.copyright}</span>
							</div>
							<div class="podcast-episodes">
								<a href="${h.url_for(controller='/admin/media', action='edit', id='new', podcast=podcast.id)}" class="btn f-lft"><span>Add episode</span></a>
								<div py:strip="True"><strong>
									<i18n:choose numeral="podcast.media_count" params="num">
										<a i18n:singular="" href="${h.url_for(controller='admin/media', action='edit', id=podcast.media.first().id)}" class="view-episodes">View First Episode ${''}</a>
										<a i18n:plural="" href="${h.url_for(controller='admin/media', podcast=podcast.slug, id=None)}" class="view-episodes">View All ${podcast.media_count} Episodes</a>
									</i18n:choose></strong>
								</div>
							</div>
						</div>
					</td>
				</tr>
			</py:for>
		</tbody>
		<xi:include href="../helpers.html" />
		${paginated_tfoot(paginator, '2')}
	</table>
</html>

